package Demo3;

public class Animal {
    private String name;
    private int age;

    private static int number = 10;
    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //和普通的类定义类似
    //静态内部类
    static class Bird {
        private String color;

        //只有静态的可以使用
        public static void main(String[] args) {

            //匿名对象
            System.out.println(new Animal("xiaoxiao", 3).age);
        }
        public Bird(String color) {
            this.color = color;
        }

        public String getColor() {
            return color;
        }

        public void setColor(String color) {
            this.color = color;
        }

        @Override
        public String toString() {
            return "Bird{" +
                    "color='" + color + '\'' +
                    '}';
        }
    }

}
